<% extend './shared/admin-base' %>
<% block 'head': %>
<link rel="stylesheet" href="/dist/admin-goods-list.css">
<% end %>

<div class="row" ng-controller="AppCtrl">
    <div class="col-md-12">
        <div class="portlet ">
            <div class="portlet-title">
                <div class="caption"><i class="fa fa-users"></i>商品管理</div>
                <div class="tools">
                    <div class="btn-group" data-toggle="buttons">
                        <label class="btn default btn {{tab == 0 ? " active": ""}}" >
                        <a ng-href="#/active">
                            <input type="radio" name="options" class="toggle">上架了的商品
                        </a>
                        </label>
                        <label class="btn default btn tab-toggle {{tab == 1 ? " active": ""}}" >
                        <a ng-href="#/inactive">
                            <input type="radio" name="options" class="toggle">下架了的商品
                        </a>
                        </label>
                    </div>
                </div>
            </div>
            <div class="portlet-body">
                <div ng-view></div>
                <div ng-bind-html="test"></div>
                <div simple-datatable ng-model="list" sdt-action-col="actionColFactory" sdt-on="sdtOn">
                    <div class="row" style="margin-top: 20px; margin-bottom: 20px;">
                        <div class=" col-md-4 col-md-offset-8">
                            <div class="input-group">
                                <input type="text" class="form-control" sdt-search-input placeholder="可输入编号、标题、类型进行搜索">
                                <span class="input-group-addon" sdt-search-btn><i class="fa fa-search"></i></span>
                            </div>
                        </div>

                    </div>
                    <div class="alert alert-sm alert-info alert-dismissible ">
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                        可搜索商品标题、类型。点击表格头中的列项，可对该项进行升序降序切换排序。
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <table class="table table-striped table-hover table-bordered">
                                <thead>
                                <tr>
                                    <th class="id-col" data-sdt-col="id">编号</th>
                                    <th data-sdt-col="mainImg" class="img-col">图片</th>
                                    <th data-sdt-col="title">标题</th>
                                    <th class="txt-col-sm" data-sdt-col="GoodsType.title">类型</th>
                                    <th class="num-col-sm" data-sdt-col="price">现价</th>
                                    <th class="num-col-sm" data-sdt-col="oldPrice">原价</th>
                                    <th class="num-col-sm" data-sdt-col="soldNum">已售</th>
                                    <th class="num-col-sm" data-sdt-col="capacity">剩余</th>
                                    <th style="width: 180px;"></th>
                                </tr>
                                </thead>
                                <tbody>
                                </tbody>
                            </table>
                            <div class="clearfix text-center">
                                <span class="pull-left">共<span sdt-total-label></span> 第<span sdt-page></span>/<span
                                        sdt-total-page></span>页</span>
                                <div style="width: 160px; display: inline-block;">
                                    <div class="input-group">
                                        <input type="text" class="form-control" sdt-page-input >
                                        <span class="input-group-addon">/<span sdt-total-page></span></span>
                                        <span class="input-group-addon" sdt-page-btn><i class="fa fa-angle-right"></i></span>
                                    </div>
                                </div>

                                <div class="btn-group pull-right" role="group" aria-label="...">
                                    <button type="button" class="btn btn-sm btn-default" sdt-prev-btn>上一页</button>
                                    <button type="button" class="btn btn-sm btn-default" sdt-next-btn>下一页</button>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/x-handlebars-template" id="row-btn">
    <td>
        <div class="btn-group dropup btn-group-sm">
            <button type="button" class="btn btn-primary" sdt-row-click="remove, up" ng-show="row.status == 0">上架
            </button>
            <button type="button" class="btn btn-primary" sdt-row-click="remove, down" ng-show="row.status == 1">下架
            </button>
            <!--<button type="button" class="btn btn-success" sdt-row-click="look">查看</button>-->
            <a class="btn btn-default" href="/adminer/goods/save/{{row.id}}">编辑</a>
            <button type="button" class="btn btn-warning" sdt-row-click="remove, del">删除</button>
        </div>
    </td>
</script>

<% block 'scripts': %>
<script src="/dist/admin-goods-list.js"></script>
<% end %>



